<?php
/**
* Author: Porlock
* Link: www.porlockz.com
* Date: 2018-04-22 19:29:18
* Last Modified time: 
* Use：
*/
/**
 * 参赛选手权限控制
 * @return [type] [description]
 */
function player_rightCtrl(){
	if (!isset($_SESSION['uid'])){
		$_SESSION['destination'] = $_SERVER['REQUEST_URI'];
		echo <<< success
	    <script type="text/javascript" src="../layui/layui.all.js"></script>
	    <script type="text/javascript">
	        layer.msg('请先登录', {
	          icon: 6,
	          time: 500 
	        }, function(){
	          window.location.href="/afctf/index.php?action=login";
	        });   
	    </script>
success;
	die();
		// die ("<meta http-equiv=refresh content='0; url=/afctf/index.php?action=login'>");
	}
}
function admin_rightCtrl(){
	if (!isset($_SESSION['aid'])){
		echo <<< success
	    <script type="text/javascript" src="../layui/layui.all.js"></script>
	    <script type="text/javascript">
	        layer.msg('请先登录', {
	          icon: 6,
	          time: 500 
	        }, function(){
	          window.location.href="/afctf/admin/login.php?action=login";
	        });   
	    </script>
success;
	die();
	}
}
?>